package ast;

import java.util.ArrayList;

public class LabelDisjunction extends Label {

	private ArrayList<Label> ops;
	
	public LabelDisjunction(ArrayList<Label> ops)
	{
		this.ops = ops;
	}
	
	public LabelDisjunction(Label l1, Label l2)
	{
		this.ops = new ArrayList<Label>();
		this.ops.add(l1);
		this.ops.add(l2);
	}
	
	public ArrayList<Label> getOps()
	{
		return ops;
	}
	
	public void setComponentLabel(int i, Label lb)
	{
		ops.set(i, lb);
	}
	
	public String toString()
	{
		String res = "(";
		for (int i = 0; i < ops.size(); i++) {
			res += ops.get(i);
			if (i != ops.size() - 1) 
				res += "+";
		}
		res += ")";
		
		return res;		
	}
}
